package com.web.startup;

import org.springframework.context.annotation.Configuration;
import org.springframework.messaging.simp.config.MessageBrokerRegistry;
import org.springframework.web.socket.config.annotation.AbstractWebSocketMessageBrokerConfigurer;
import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker;
import org.springframework.web.socket.config.annotation.StompEndpointRegistry;

/**
 * Created with IntelliJ IDEA.
 * User: xf
 * Date: 2016/5/7
 * Time: 13:48
 * To change this template use Editor | File and Code Templates.
 */
//@Configuration
//@EnableWebSocketMessageBroker
//public class WebSocketStompConfig extends AbstractWebSocketMessageBrokerConfigurer {

//    @Override
//    public void registerStompEndpoints(StompEndpointRegistry registry) {
//        registry.addEndpoint("/marcopolo").withSockJS();
//    }

    /**
     * enableSimpleBroker:基于内存的消息代理
     * enableStompBrokerRelay:第三方消息代理--RabbitMQ
     *
     * @param registry
     */
//    @Override
//    public void configureMessageBroker(MessageBrokerRegistry registry) {
//        registry.enableSimpleBroker("/topic", "/queue");
////        registry.enableStompBrokerRelay("/topic", "/queue")
////                .setRelayHost("127.0.0.1")
////                .setRelayPort(15672)
////                .setClientLogin("guest")
////                .setClientPasscode("guest");
//        registry.setApplicationDestinationPrefixes("/app");
//    }


//}
